package com.qingke.note;

import java.util.Scanner;

public class Console {

	static Scanner scanner = new Scanner(System.in);
	public static void println(Object object){
		System.out.println(object);
	}
	
	public static void print(Object object){
		System.out.print(object);
	}
	
	public static String askInput(String string){
		print(string+">");
		String input = scanner.nextLine();
		return input.trim();
	}
	
	public static int askInputInt(String string){
		String input=null;
		while(true){
			print(string+">");
			try {
				input= scanner.nextLine();
				int number = Integer.parseInt(input);
				return number;
			} catch (Exception e) {
				Console.println("请输入合法的数字");
			}
		}
	}
	
	public static void printHelp(){
		Console.println("=====帮助信息=====");
		Console.println("帮助信息               help");
		Console.println("用户注册               signup");
		Console.println("用户登录               login");
		Console.println("查看备忘               list");
		Console.println("新建信息               new");
		Console.println("更改信息               update");
		Console.println("删除信息               delete");
		Console.println("退出登录               logout");
		Console.println("关闭程序               exit");
		Console.println("==============");
	}
	
}
